
import { DataTypes } from 'sequelize'
import seq from '@/mysql/db/seq.db'

// 创建数据库模型 代码生成表
const EquipmentEquipmentupload = seq.define(
  'equipment_equipmentupload',
  {
    table_id: {
        type: DataTypes.BIGINT,
        allowNull: false,
        unique: true,
        autoIncrement: true,
        primaryKey: true,
        comment: "编号"
      },
    filepath: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "表名称"
      },
    new_filename: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "关联子表的表名"
      },
    original_filename: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "子表关联的外键名"
      },
    class_name: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "实体类名称"
      },
    tpl_category: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "使用的模板（crud单表操作 tree树表操作 sub主子表）"
      },
    package_name: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "生成包路径"
      },
    create_by: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "创建者"
      },
    update_by: {
        type: DataTypes.CHAR,
        defaultValue:'',
        comment: "更新者"
      },
    created_at: {
        type: DataTypes.DATE,
        defaultValue:'',
        comment: ""
      },
    updated_at: {
        type: DataTypes.DATE,
        defaultValue:'',
        comment: ""
      },

  },
  {
    tableName: 'equipment_equipmentupload', // 强制创建表名
    freezeTableName: true, // 告诉sequelize不需要自动将表名变成复数
    comment: '代码生成表'
  }
)

export default EquipmentEquipmentupload